package com.cragon.observer;

import java.util.Observable;

/**
 * @Description: TODO
 * @Author: ZHOUHAILONG
 * @Date: 2020年07月31日 10:06
 */
public class BeWatched extends Observable {
	public void counter(int num) {
		for (; num >= 0; num--) {
			setChanged();
			notifyObservers(num);

			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				System.out.println("Sleep interrupted");
			}
		}
	}
}
